﻿using Core.Log;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace Core.Tools
{
    public class TypeHelper
    {
        public static Object? GetObjectByTypeName(string typeName)
        {
            Type? t = null;
            Object? obj = null;
            try
            {
                t = Type.GetType(typeName);
                if (t != null)
                {
                    obj = Activator.CreateInstance(t);
                }
            }
            catch (Exception ex)
            {
                ExLog.ErrorLogCore(ex.Message);
            }
            return obj;
        }
    }
}
